﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace gChartSharp
{
    /// <summary>
    /// A utility class to contain useful methods
    /// </summary>
    public class ChartHelper
    {
        /// <summary>
        /// Returns the hex value of a color.
        /// 
        /// i.e. Red -> ff0000
        /// </summary>
        /// <param name="color"></param>
        /// <returns></returns>
        public static string ConvertColorToHex(Color color)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0:x2}", color.R);
            sb.AppendFormat("{0:x2}", color.G);
            sb.AppendFormat("{0:x2}", color.B);
            return sb.ToString();
        }
    }
}
